<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改借款')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-amount-edit" th:object="${borrowingAmount}">
            <input name="bId" th:field="*{bId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">借款类型：</label>
                <div class="col-sm-8">
                    <div class="radio-box">
                        <select id="bStatus" name="bStatus" th:with="type=${@dict.getType('borrowing_status')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}">
                        </select>
                    </div>
                </div>
            </div>
            <div class="form-group" style="display: none">
                <label class="col-sm-3 control-label">借款申请人：</label>
                <div class="col-sm-8">
                    <input name="bApplicant" th:field="*{bApplicant}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group" style="display: none">
                <label class="col-sm-3 control-label">借款时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="bTime" th:value="${#dates.format(borrowingAmount.bTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">借款原因：</label>
                <div class="col-sm-8">
                    <input name="bCause" th:field="*{bCause}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">借款金额：</label>
                <div class="col-sm-8">
                    <input name="bAmount" th:field="*{bAmount}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group" style="display: none">
                <label class="col-sm-3 control-label">余额：</label>
                <div class="col-sm-8">
                    <input name="bBalance" th:field="*{bBalance}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group" style="display: none">
                <label class="col-sm-3 control-label">审批类型：</label>
                <div class="col-sm-8">
                    <select id="bType" name="bType" th:with="type=${@dict.getType('borrowing_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}">
                    </select>
                </div>
            </div>
            <div class="form-group" style="display: none">
                <label class="col-sm-3 control-label">审批意见：</label>
                <div class="col-sm-8">
                    <input name="bOpinion" th:field="*{bOpinion}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "ruoyi/amount";
        $("#form-amount-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-amount-edit').serialize());
            }
        }
    </script>
</body>
</html>